﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Colorful.Models
{
    public class VisitorInfo : BaseId
    {
        /// <summary>
        /// 访问域名
        /// </summary>
        public string Domain { get; set; }
        /// <summary>
        /// 访问地址
        /// </summary>
        public string Page { get; set; }
        /// <summary>
        /// 页面查询字符串
        /// </summary>
        public string PageQuery { get; set; }
        /// <summary>
        /// 用时
        /// </summary>
        public long Time { get; set; }
        /// <summary>
        /// 入站流量
        /// </summary>
        public long RequestLength { get; set; }
        /// <summary>
        /// 出站流量
        /// </summary>
        public long ResponseLength { get; set; }
        /// <summary>
        /// 提交方法
        /// </summary>
        public string HttpMethod { get; set; }
        /// <summary>
        /// 来源
        /// </summary>
        public string Source { get; set; }
        /// <summary>
        /// IP地址
        /// </summary>
        public string IP { get; set; }
        /// <summary>
        /// 登陆Id（如会员Id、展商Id等登录Id）
        /// </summary>
        public string LoginId { get; set; }
        /// <summary>
        /// 特殊标识（如：Member、Visitor、Exhibitor）
        /// </summary>
        public string Flag { get; set; }
        /// <summary>
        /// 语言
        /// </summary>
        public string Lang { get; set; }
        /// <summary>
        /// 用户跟踪Id
        /// </summary>
        public string TrackingId { get; set; }
    }
    public class VisitorRecord : VisitorInfo
    {
        /// <summary>
        /// 国家
        /// </summary>
        public string Country { get; set; }
        /// <summary>
        /// 区域
        /// </summary>
        public string Area { get; set; }
        /// <summary>
        /// 省
        /// </summary>
        public string Province { get; set; }
        /// <summary>
        /// 市
        /// </summary>
        public string City { get; set; }
        /// <summary>
        /// 数据网提供商
        /// </summary>
        public string ISP { get; set; }
        /// <summary>
        /// 所属系统
        /// </summary>
        public string OS { get; set; }
        /// <summary>
        /// 浏览器
        /// </summary>
        public string Browser { get; set; }
        /// <summary>
        /// 浏览器版本
        /// </summary>
        public string Version { get; set; }
        /// <summary>
        /// 浏览器内核
        /// </summary>
        public string Engine { get; set; }
        /// <summary>
        /// 浏览器内核版本
        /// </summary>
        public string EngineVersion { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        public string Device { get; set; }
        /// <summary>
        /// 厂商
        /// </summary>
        public string Vendor { get; set; }
        /// <summary>
        /// 是否为爬虫
        /// </summary>
        public bool IsSpider { get; set; }
        /// <summary>
        /// 是否为手机端
        /// </summary>
        public bool IsMobile { get; set; }

        #region Ignore
        /// <summary>
        /// 是否为微信
        /// </summary>
        public bool IsWeiXin
        {
            get
            {
                return this.Browser == "WeChat";
            }
        }
        #endregion

    }
}
